import { userInfoKey } from "./../constant/index.js"

//获取用户信息
export function getUserInfo(){	
	return new Promise((resolve,reject)=>{
		uni.getStorage({
		    key: userInfoKey,
		    success: function (data) {
				resolve(data.data)
		    },
			fail: function (){
				uni.navigateTo({url:`/pages/login/login`})
			}
		});
	})
}

export function removeUserInfo(){	
	return new Promise((resolve,reject)=>{
		uni.removeStorage({
		    key: userInfoKey,
		    success: function () {
				uni.navigateTo({url:`/pages/login/login`})
		    },
			fail: function (){
				
			}
		});
	})
}